package player

import (
	"proto/player"
	"test_client/logic/gate/api"
)

type playerRpc struct {
}

var (
	rpc = new(playerRpc)
)

func (*playerRpc) Login(account string, password string) {
	data := new(proto_player.Login)
	data.Account = account
	data.Password = password

	gate_api.Write(data)
}

func (*playerRpc) Logout() {
	request := new(proto_player.Logout)
	gate_api.Write(request)
}

func (*playerRpc) SyncData() {
	request := new(proto_player.SyncData)
	gate_api.Send(request)
}

func (*playerRpc) TestSetLevel(level uint16) {
	request := new(proto_player.TestSetLevel)
	request.Level = uint32(level)

	gate_api.Send(request)
}

func (*playerRpc) TestSetName(name string) {
	request := new(proto_player.TestSetName)
	request.Name = name

	gate_api.Send(request)
}
